package org.snia.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Spring容器环境上下文对象
 * 
 * @author c90004011
 * @version CloudStore CSE Service Platform Subproject, 2010-5-1
 * @see
 * @since
 */
public class BaseStaticContextLoader
    implements ApplicationContextAware
{
    // Spring的应用容器对象
    private static ApplicationContext applicationContext;

    /**
     * 设置applicationContext
     * 
     * @param applicationContext 上下文对象
     * @throws BeansException 异常
     */
    @Override
	public void setApplicationContext(ApplicationContext applicationContext)
        throws BeansException
    {
        BaseStaticContextLoader.applicationContext = applicationContext;
    }

    /**
     * 获取applicationContext
     * 
     * @return ApplicationContext 上下文对象
     */
    public static ApplicationContext getApplicationContext()
    {
        return applicationContext;
    }
}
